import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JToolBar;


public class ToolBar extends JToolBar 
	implements ActionListener
{
	JButton mb1 = new JButton("Test1");
	JButton mb2 = new JButton("Test2");
	JButton mb3 = new JButton("Test3");
	JButton mb4 = new JButton("Test4");
	JButton mb5 = new JButton("Test5");
	JButton mb6 = new JButton("Test6");
	JButton mb7 = new JButton("Test7");
	JButton mb8 = new JButton("Test8");
	JButton mb9 = new JButton("Test9");
	
	
	public ToolBar(){
		mb1.addActionListener(this);
		mb2.addActionListener(this);
		mb3.addActionListener(this);
		mb4.addActionListener(this);
		mb5.addActionListener(this);
		mb6.addActionListener(this);
		mb7.addActionListener(this);
		mb8.addActionListener(this);
		mb9.addActionListener(this);
		//mb1.addActionListener(this);
		
		this.add(mb1);
		this.add(mb2);
		this.add(mb3);
		this.add(mb4);
		this.add(mb5);
		this.add(mb6);
		this.add(mb7);
		this.add(mb8);
		this.add(mb9);
	}


	@Override
	public void actionPerformed(ActionEvent event) {
		String s = event.getActionCommand();
		System.out.println("[action]."+s);
		if( s == "Test1"){
			TestPanel.Gi().addKid(0, !TestPanel.Gi().isActive(0));
		}
		else if( s == "Test2"){
			TestPanel.Gi().addKid(1, !TestPanel.Gi().isActive(1));
		}
		else if( s == "Test3"){
			TestPanel.Gi().addKid(2, !TestPanel.Gi().isActive(2));
		}
		else if( s == "Test4"){
			TestPanel.Gi().addKid(3, !TestPanel.Gi().isActive(3));
		}
		else if( s == "Test5"){
			
		}
		else if( s == "Test6"){
			
		}
		else if( s == "Test7"){
			
		}
		else if( s == "Test8"){
			
		}
		else if( s == "Test9"){
			
		}
		else {
			
		}
	}
}
